<template>
  <div v-if="isShow" class="right-message-content" @click.prevent="handleHide">
    <div class="right-message-text">
      <div class="tex-r pd message-text-title">
        <span>消息通知</span>
      </div>
      <div class="message-t-h">
        <div class="fl-x pd message-text-content">
          <div class="el-icon-message fl-w"></div>
          <div class="fl-1">
            <h4>测试人：</h4>
            <div>
              <h5>发布下测试环境</h5>
              <p>爱的发声懂法守法萨斯给热熔法撒是发表的方式被告人同时也会让体验和人工非常高大概的股份让的感染而给他认为大沙发额外染头发</p>
            </div>
            <div class="date">2021-01-14 09:21:51</div>
          </div>
        </div>
        <div class="fl-x pd message-text-content">
          <div class="el-icon-message fl-w"></div>
          <div class="fl-1">
            <h4>测试人：</h4>
            <div>
              <h5>发布下测试环境</h5>
              <p>爱的发声懂法守法萨斯给热熔法撒是发表的方式被告人同时也会让体验和人工非常高大概的股份让的感染而给他认为大沙发额外染头发</p>
            </div>
            <div class="date">2021-01-14 09:21:51</div>
          </div>
        </div>
        <div class="fl-x pd message-text-content">
          <div class="el-icon-message fl-w"></div>
          <div class="fl-1">
            <h4>测试人：</h4>
            <div>
              <h5>发布下测试环境</h5>
              <p>爱的发声懂法守法萨斯给热熔法撒是发表的方式被告人同时也会让体验和人工非常高大概的股份让的感染而给他认为大沙发额外染头发</p>
            </div>
            <div class="date">2021-01-14 09:21:51</div>
          </div>
        </div>
        <div class="fl-x pd message-text-content">
          <div class="el-icon-message fl-w"></div>
          <div class="fl-1">
            <h4>测试人：</h4>
            <div>
              <h5>发布下测试环境</h5>
              <p>爱的发声懂法守法萨斯给热熔法撒是发表的方式被告人同时也会让体验和人工非常高大概的股份让的感染而给他认为大沙发额外染头发</p>
            </div>
            <div class="date">2021-01-14 09:21:51</div>
          </div>
        </div>
        <div class="fl-x pd message-text-content">
          <div class="el-icon-message fl-w"></div>
          <div class="fl-1">
            <h4>测试人：</h4>
            <div>
              <h5>发布下测试环境</h5>
              <p>爱的发声懂法守法萨斯给热熔法撒是发表的方式被告人同时也会让体验和人工非常高大概的股份让的感染而给他认为大沙发额外染头发</p>
            </div>
            <div class="date">2021-01-14 09:21:51</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: false
    }
  },
  methods: {
    initData(val) {
      this.isShow = val
      setTimeout(() => {
        document.getElementsByClassName('right-message-text')[0].style.right = 0
      })
    },
    handleHide() {
      document.getElementsByClassName('right-message-text')[0].style.right = -300 + 'px'
      setTimeout(() => {
        this.isShow = false
      }, 500)
    },
    toMessage() {
    }
  }
}
</script>

<style scoped lang="scss">
.right-message-content {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 9999999;
  .right-message-text {
    background: #5d5a5a;
    width: 300px;
    color: #2EF5F4;
    position: fixed;
    top: 0;
    right: -300px;
    bottom: 0;
    transition: right 0.5s;
    .message-t-h {
      height: calc(100vh - 26px);
      overflow-y: auto;
      padding-bottom: 6px;
    }
    .pd {
      padding:0 12px;
      padding-top: 10px;
    }
    .message-text-title {
      padding-bottom: 6px;
    }
    .message-text-content {
      background: #4c4646;
      margin-bottom: 6px;
      padding-bottom: 6px;
    }
    .fl-x {
      display: flex;
      .fl-1 {
        flex: 1;
        h4 {
          height: 24px;
          line-height: 24px;
          color: #FFFFFF;
        }
        .date {
          font-size: 12px;
          color: #cccccc;
        }
        h5 {
          color: #cccccc;
          height: 20px;
          line-height: 20px;
        }
        p {
          //white-space: nowrap;
          //overflow: hidden;
          //text-overflow: ellipsis;
          color: #dddddd;
          font-size: 12px;
          line-height: 22px;
        }
      }
      .fl-w {
        width: 40px;
        color: #00ff80;
        font-size: 26px;
      }
    }
    .tex-r {
      text-align: right;
      color: #00a1ff;
      font-size: 12px;
      &:hover {
        color: #FFFFFF;
      }
    }
  }
}
</style>
